﻿@model CommentListModel
@{ 
    CssLink.Add("~/Content/css/comment.css");
    int 번호 = 1; 
}

@foreach(var 덧글 in Model.목록) {
    <div class="덧글">
        @if (현재사용자.사용자.관리자 || 현재사용자.사용자.ID == 덧글.사용자ID) {
            <div class="controls pull-right">
                <div class="btn-group">
                    <a class="btn dropdown-toggle btn-small" data-toggle="dropdown">편집<span class="caret"></span></a>
                    <ul class="dropdown-menu">
                        <li><a onclick="덧글입력(@덧글.대상구분, @덧글.대상ID, @덧글.ID, $(this).parents('div.덧글').find('div.내용').text())">덧글 편집하기</a></li>
                        <li><a onclick="덧글삭제(@덧글.ID, @덧글.대상구분, @Model.대상ID)">덧글 삭제</a></li>
                    </ul>
                </div>
            </div>
        }
        <div class="머리">
            <span>@(번호++).</span> 
            <span>@덧글.작성자</span>
            <span>@덧글.생성일.ToYMDHM()</span>
        </div>
        <div class="내용">@덧글.내용</div>
    </div>
}
